#include "string.h"
void test1()
{
    cout << "TEST1:" << endl;
    String x,y;
    cout << "Please enter two strings\n";
    cin >> x >> y;
    cout << "input: " << x << ' ' << y << endl;
    cout << x + y << endl;

    String z = x;
    cout << z << endl;

    z[0] = '0';
    cout << x[0] << endl;

    if( z == x){
        cout << " z == x " << endl;
    }
    else{
        cout << " z != x" << endl;
    }
    if( z != x ){
        cout << " z != x " << endl;
    }else{
        cout << " z == x" << endl;
    }
    for(int i = 0; i < z.size(); i++)
    {
        cout << z[i] << " " ;
    }
    cout << endl;
    String str = x;
    for(int i = 0; i < str.size(); i++){
        cout << str[i] << " ";
    }
    cout << endl << endl;
}
void test2()
{
    String str= "123456";
    cout << "Using iterator:" << endl;
    String_iter iter(str);
    iter.next() = 'z';
    iter.reset();
    for(int i = 0; i < str.size(); i++){
        cout << iter.next();
    }
    const String constStr= "CONST_STRING";
    cout << constStr << endl;
    
    cout << constStr(1,2) << endl;

    String testString = "TEST_STRING";
    cout << testString(1,3) << endl;
    testString(1,4) = "zhu";
    cout << testString << endl;
}

    
int main()
{

    test1();
    test2();
    

}
